job_performance_unconditional,
preference_unconditional,
file = "tables/conditional_party_congruence.Rdata"
)
male_female <-
productivity[productivity$gender_pairing == "Man-Woman", ]
results_male_female <-
amce(
preference ~ mp_gender + mp_party + committee_membership +
issue_campaigning + voting_legislation + constituency_responsiveness,
data = male_female
)
plot(
results_male_female,
xlab = "Change in Pr(Preferred Member of Parliament)",
attribute.names = c(
"Committee Membership",
"Constituency Responsiveness",
"Issue Campaigning",
"MP Gender",
"MP Party",
"Voting and Legislation"
),
main = "",
text.size = 10
)
pdf("plots/figure_S1_amce_male_female.pdf", 7, 4)
figure_S1 <- plot(
results_male_female,
xlab = "Change in Pr(Preferred Member of Parliament)",
attribute.names = c(
"Committee Membership",
"Constituency Responsiveness",
"Issue Campaigning",
"MP Gender",
"MP Party",
"Voting and Legislation"
),
main = "",
text.size = 10
)
ggsave("plots/figure_S1_amce_male_female.pdf", height = 7, width = 4)
ggsave("plots/figure_S1_amce_male_female.pdf", figure_S1, height = 7, width = 4)
plot(
results_male_female,
xlab = "Change in Pr(Preferred Member of Parliament)",
attribute.names = c(
"Committee Membership",
"Constituency Responsiveness",
"Issue Campaigning",
"MP Gender",
"MP Party",
"Voting and Legislation"
),
main = "",
text.size = 10
)
plot(
results_male_female,
xlab = "Change in Pr(Preferred Member of Parliament)",
attribute.names = c(
"Committee Membership",
"Constituency Responsiveness",
"Issue Campaigning",
"MP Gender",
"MP Party",
"Voting and Legislation"
),
main = "",
text.size = 10
)
figure_S1 <- plot(
results_male_female,
xlab = "Change in Pr(Preferred Member of Parliament)",
attribute.names = c(
"Committee Membership",
"Constituency Responsiveness",
"Issue Campaigning",
"MP Gender",
"MP Party",
"Voting and Legislation"
),
main = "",
text.size = 10
)
ggsave("plots/figure_S1_amce_male_female.pdf",
figure_S1,
height = 4,
width = 6)
GETWD()
getwd()
ggsave("plots/figure_S1_amce_male_female.png",
figure_S1,
height = 4,
width = 6)
male_female <-
productivity[productivity$gender_pairing == "Man-Woman", ]
results_male_female <-
amce(
preference ~ mp_gender + mp_party + committee_membership +
issue_campaigning + voting_legislation + constituency_responsiveness,
data = male_female
)
results_male_female <-
amce(
preference ~ mp_gender + mp_party + committee_membership +
issue_campaigning + voting_legislation + constituency_responsiveness,
respondent.id = ID,
data = male_female
)
results_male_female <-
amce(
preference ~ mp_gender + mp_party + committee_membership +
issue_campaigning + voting_legislation + constituency_responsiveness,
respondent.id = ID,
data = male_female
)
plot(
results_male_female,
xlab = "Change in Pr(Preferred Member of Parliament)",
attribute.names = c(
"Committee Membership",
"Constituency Responsiveness",
"Issue Campaigning",
"MP Gender",
"MP Party",
"Voting and Legislation"
),
main = "",
text.size = 10
)
figure_S1 <- plot(
results_male_female,
xlab = "Change in Pr(Preferred Member of Parliament)",
attribute.names = c(
"Committee Membership",
"Constituency Responsiveness",
"Issue Campaigning",
"MP Gender",
"MP Party",
"Voting and Legislation"
),
main = "",
text.size = 10
)
ggsave("plots/figure_S1_amce_male_female.png",
figure_S1,
height = 4,
width = 6)
ggsave("plots/figure_S1_amce_male_female.png", figure_S1,  height = 4, width = 6)
setwd("C:/Users/LotteHargrave/Dropbox/projects/productivity_experiment/replication")
figure_S1 <- plot(
results_male_female,
xlab = "Change in Pr(Preferred Member of Parliament)",
attribute.names = c(
"Committee Membership",
"Constituency Responsiveness",
"Issue Campaigning",
"MP Gender",
"MP Party",
"Voting and Legislation"
),
main = "",
text.size = 10
)
ggsave("plots/figure_S1_amce_male_female.png", figure_S1,  height = 4, width = 6)
pdf("plots/figure_S1_amce_male_female.pdf", 7, 4)
pdf("plots/figure_S1_amce_male_female.pdf", 7, 4)
amce(
preference ~ mp_gender + mp_party + committee_membership +
issue_campaigning + voting_legislation + constituency_responsiveness,
respondent.id = ID,
data = male_female
)
View(male_female)
?ace
?amce
results_male_female <-
amce(
preference ~ mp_gender + mp_party + committee_membership +
issue_campaigning + voting_legislation + constituency_responsiveness,
respondent.id = NULL,
data = male_female
)
plot(
results_male_female,
xlab = "Change in Pr(Preferred Member of Parliament)",
attribute.names = c(
"Committee Membership",
"Constituency Responsiveness",
"Issue Campaigning",
"MP Gender",
"MP Party",
"Voting and Legislation"
),
main = "",
text.size = 10
)
pdf("plots/figure_S1_amce_male_female.pdf", 7, 4)
ggsave("plots/figure_S1_amce_male_female.png", figure_S1,  height = 4, width = 6)
setwd("C:/Users/LotteHargrave/Dropbox/projects/productivity_experiment/replication")
rm(list = ls())
library(data.table) # CRAN v1.14.2
library(plyr) # CRAN v1.8.6
library(dplyr) # CRAN v1.0.9
library(tidyverse) # CRAN v1.3.1
library(cjoint) # CRAN v2.1.0
library(ggplot2) # CRAN v3.3.6
library(broom) # CRAN v0.7.11
library(patchwork) # CRAN v1.1.1
library(estimatr) # CRAN v0.30.6
load("data/productivity.Rdata")
preference_bivariate <-
lm(
preference ~ mp_gender + mp_party + committee_membership +
issue_campaigning + voting_legislation + constituency_responsiveness,
data = productivity
)
performance_bivariate <-
lm(
perceived_performance ~ mp_gender + mp_party + committee_membership +
issue_campaigning + voting_legislation + constituency_responsiveness,
data = productivity
)
electability_bivariate <-
lm(
electability ~ mp_gender + mp_party + committee_membership +
issue_campaigning + voting_legislation + constituency_responsiveness,
data = productivity
)
save(preference_bivariate,
performance_bivariate,
electability_bivariate,
file = "tables/unconditional.Rdata")
electability <-
lm(electability ~ mp_gender * objective_performance, data = productivity)
job_performance <-
lm(perceived_performance ~ mp_gender * objective_performance,
data = productivity)
preference <-
lm(preference ~ mp_gender * objective_performance, data = productivity)
electability_levels <-
lm(
electability ~ mp_gender * committee_membership + mp_gender * issue_campaigning + mp_gender *
voting_legislation +
mp_gender * constituency_responsiveness,
data = productivity
)
job_performance_levels <-
lm(
perceived_performance ~ mp_gender * committee_membership + mp_gender * issue_campaigning + mp_gender *
voting_legislation +
mp_gender * constituency_responsiveness,
data = productivity
)
preference_levels <-
lm(
preference ~ mp_gender * committee_membership + mp_gender * issue_campaigning + mp_gender *
voting_legislation +
mp_gender * constituency_responsiveness,
data = productivity
)
save(
electability,
job_performance,
preference,
electability_levels,
job_performance_levels,
preference_levels,
file = "tables/conditional_mp_gender.Rdata"
)
job_performance_0 <-
lm(perceived_performance ~ mp_gender * performance_0_dummy, data = productivity)
job_performance_1 <-
lm(perceived_performance ~ mp_gender * performance_1_dummy, data = productivity)
job_performance_2 <-
lm(perceived_performance ~ mp_gender * performance_2_dummy, data = productivity)
job_performance_3 <-
lm(perceived_performance ~ mp_gender * performance_3_dummy, data = productivity)
job_performance_4 <-
lm(perceived_performance ~ mp_gender * performance_4_dummy, data = productivity)
electability_0 <-
lm(electability ~ mp_gender * performance_0_dummy, data = productivity)
electability_1 <-
lm(electability ~ mp_gender * performance_1_dummy, data = productivity)
electability_2 <-
lm(electability ~ mp_gender * performance_2_dummy, data = productivity)
electability_3 <-
lm(electability ~ mp_gender * performance_3_dummy, data = productivity)
electability_4 <-
lm(electability ~ mp_gender * performance_4_dummy, data = productivity)
preference_0 <-
lm(preference ~ mp_gender * performance_0_dummy, data = productivity)
preference_1 <-
lm(preference ~ mp_gender * performance_1_dummy, data = productivity)
preference_2 <-
lm(preference ~ mp_gender * performance_2_dummy, data = productivity)
preference_3 <-
lm(preference ~ mp_gender * performance_3_dummy, data = productivity)
preference_4 <-
lm(preference ~ mp_gender * performance_4_dummy, data = productivity)
save(
job_performance_0,
job_performance_1,
job_performance_2,
job_performance_3,
job_performance_4,
electability_0,
electability_1,
electability_2,
electability_3,
electability_4,
preference_0,
preference_1,
preference_2,
preference_3,
preference_4,
file = "tables/conditional_nonlinear.Rdata"
)
electability_unconditional <-
lm(electability ~ party_congruence, data = productivity)
electability <-
lm(electability ~ party_congruence * objective_performance, data = productivity)
job_performance_unconditional <-
lm(perceived_performance ~ party_congruence, data = productivity)
job_performance <-
lm(perceived_performance ~ party_congruence * objective_performance,
data = productivity)
preference_unconditional <-
lm(preference ~ party_congruence, data = productivity)
preference <-
lm(preference ~ party_congruence * objective_performance, data = productivity)
electability_levels <-
lm(
electability ~ party_congruence * committee_membership + party_congruence *
issue_campaigning +
party_congruence * voting_legislation + party_congruence *
constituency_responsiveness,
data = productivity
)
job_performance_levels <-
lm(
perceived_performance ~ party_congruence * committee_membership + party_congruence *
issue_campaigning +
party_congruence * voting_legislation + party_congruence *
constituency_responsiveness,
data = productivity
)
preference_levels <-
lm(
preference ~ party_congruence * committee_membership + party_congruence *
issue_campaigning +
party_congruence * voting_legislation + party_congruence *
constituency_responsiveness,
data = productivity
)
save(
electability,
job_performance,
preference,
electability_levels,
job_performance_levels,
preference_levels,
electability_unconditional,
job_performance_unconditional,
preference_unconditional,
file = "tables/conditional_party_congruence.Rdata"
)
male_female <-
productivity[productivity$gender_pairing == "Man-Woman", ]
results_male_female <-
amce(
preference ~ mp_gender + mp_party + committee_membership +
issue_campaigning + voting_legislation + constituency_responsiveness,
respondent.id = NULL,
data = male_female
)
pdf("plots/figure_S1_amce_male_female.pdf", 7, 4)
pdf("plots/figure_S1_amce_male_female.pdf", 7, 4)
plot(
results_male_female,
xlab = "Change in Pr(Preferred Member of Parliament)",
attribute.names = c(
"Committee Membership",
"Constituency Responsiveness",
"Issue Campaigning",
"MP Gender",
"MP Party",
"Voting and Legislation"
),
main = "",
text.size = 10
)
dev.off()
results_male_female <-
amce(
preference ~ mp_gender + mp_party + committee_membership +
issue_campaigning + voting_legislation + constituency_responsiveness,
respondent.id = "ID",
data = male_female
)
plot(
results_male_female,
xlab = "Change in Pr(Preferred Member of Parliament)",
attribute.names = c(
"Committee Membership",
"Constituency Responsiveness",
"Issue Campaigning",
"MP Gender",
"MP Party",
"Voting and Legislation"
),
main = "",
text.size = 10
)
plot(results_male_female,
xlab="Change in Pr(Preferred Member of Parliament)")
plot(results_male_female,
xlab="Change in Pr(Preferred Member of Parliament)",
ttribute.names = c(
"Committee Membership",
"Constituency Responsiveness",
"Issue Campaigning",
"MP Gender",
"MP Party",
"Voting and Legislation"
),
main = "",
text.size = 10)
plot(results_male_female,
xlab="Change in Pr(Preferred Member of Parliament)",
ttribute.names = c(
"Committee Membership",
"Constituency Responsiveness",
"Issue Campaigning",
"MP Gender",
"MP Party",
"Voting and Legislation"
),
main = "",
text.size = 10)
results_amce <-
lm_robust(
preference ~ mp_gender + mp_party + committee_membership +
issue_campaigning + voting_legislation + constituency_responsiveness,
data = productivity,
clusters = ID,
se_type = "stata"
)
amce <- tidy(results_amce, conf.int = T)[2:7, ]
amce$attributes <-
factor(
NA,
levels = c(
"MP Gender",
"MP Party",
"Committee Membership",
"Constituency Responsive",
"Campaign Successful",
"Voting Productive"
)
)
amce$attributes[amce$term == "mp_genderWoman"] <- "MP Gender"
amce$attributes[amce$term == "mp_partyLabour"] <- "MP Party"
amce$attributes[amce$term == "committee_membershipSits on several"] <-
"Committee Membership"
amce$attributes[amce$term == "constituency_responsivenessOften"] <-
"Constituency Responsive"
amce$attributes[amce$term == "issue_campaigningSuccessfully campaigned"] <-
"Campaign Successful"
amce$attributes[amce$term == "voting_legislationMore productive"] <-
"Voting Productive"
table(amce$attributes)
figure_2_amce <-
ggplot(amce, aes(x = estimate, y = attributes)) + geom_point(size = 3) + ylab("") + xlab("") +
geom_linerange(aes(xmin = conf.low, xmax = conf.high)) +
theme_bw() +
geom_vline(xintercept = 0, linetype = 2) +
xlim(-0.1, 0.3) +
theme(axis.text = element_text(size = 11),
axis.title = element_text(size = 11)) +
scale_y_discrete(
limits = rev,
labels = c(
"Voting\n Productive",
"Campaign\n Succcessful",
"Constituency\n Responsive",
"Committee\n Member",
"Conservative\n MP",
"Woman\n MP"
)
) +
labs(x = "Change in Pre(Preferred Member of Parliament)", y = "", title = "")
ggplot(amce, aes(x = estimate, y = attributes)) + geom_point(size = 3) + ylab("") + xlab("") +
geom_linerange(aes(xmin = conf.low, xmax = conf.high)) +
theme_bw() +
geom_vline(xintercept = 0, linetype = 2) +
xlim(-0.1, 0.3) +
theme(axis.text = element_text(size = 11),
axis.title = element_text(size = 11)) +
scale_y_discrete(
limits = rev,
labels = c(
"Voting\n Productive",
"Campaign\n Succcessful",
"Constituency\n Responsive",
"Committee\n Member",
"Conservative\n MP",
"Woman\n MP"
)
) +
labs(x = "Change in Pre(Preferred Member of Parliament)", y = "", title = "")
